﻿
using Swashbuckle.AspNetCore.Annotations;

namespace Alison.Tools.HttpContact.Response
{
    /// <summary>
    /// 请求返回定义类
    /// </summary>
    [SwaggerSchema(Title = "请求返回定义类 ApiResponse", Description = "请求返回定义类 ApiResponse")]
    public class ApiResponse
    {
        public ApiResponse(int statusCode, string message = "")
        {
            this.StatusCode = statusCode;
            this.Message = message;
        }

        public ApiResponse(int statusCode, object result = null)
        {
            this.StatusCode = statusCode;
            this.Result = result;
        }

        /// <summary>
        /// 后台消息
        /// </summary>
        [SwaggerSchema(Title = "后台消息",Description = "后台消息")]
        public string Message { get; set; }

        /// <summary>
        /// //返回状态
        /// </summary>
        [SwaggerSchema(Title = "返回状态", Description = "成功：200....")]
        public int StatusCode { get; set; }

        /// <summary>
        /// 返回结果
        /// </summary>
        [SwaggerSchema(Title = "返回结果", Description = "object类型，一般为json类型")]
        public object Result { get; set; }
    }
}
